package com.wang.quickhit;

import java.util.Scanner;

public class Player {
    private int levelNo;//级别
    private int curScore;//积分
    private long startTime;//开始时间
    private int elapsedTime;//已用时间

    public Player() {
    }

    public Player(int levelNo, int curScore, long startTime, int elapsedTime) {
        this.levelNo = levelNo;
        this.curScore = curScore;
        this.startTime = startTime;
        this.elapsedTime = elapsedTime;
    }

    public int getLevelNo() {
        return levelNo;
    }

    public void setLevelNo(int levelNo) {
        this.levelNo = levelNo;
    }

    public int getCurScore() {
        return curScore;
    }

    public void setCurScore(int curScore) {
        this.curScore = curScore;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(int elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public void play(){
        Game game = new Game(this);
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < LevelParam.levels.length; i++) {
            this.levelNo+= 1;
            this.startTime = System.currentTimeMillis();
            this.curScore = 0;
            for (int j = 0; j < LevelParam.levels[levelNo - 1].getStrTimes(); j++) {
                String outStr = game.printStr();
                String inStr = sc.next();
                game.printResult(inStr,outStr);
            }
        }
    }
}
